<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
%>
<jsp:include page="/admin/inc/incHead.jsp" flush="false"/>
<link href="<%=path %>/js/datepicker/datetimepicker.min.css" rel="stylesheet">
<script src="<%=path %>/js/datepicker/datetimepicker.min.js"></script>
<script src="<%=path %>/js/datepicker/datetimepicker.zh-CN.js"></script>
<form class="form-inline" action="<%=path %>/order/financeStatistics.action" name="formFind" method="post">
    <table width='98%' border='0' style="margin-top:8px;margin-left: 5px;">
        <tr>
            <td>
                财务统计：
                <input type="text" readonly="readonly" class="form-control" name="fromDate" id="dateFrom"
                       data-date-format="yyyy-mm-dd">
                ---
                <input type="text" readonly="readonly" class="form-control" name="toDate" id="dateTo"
                       data-date-format="yyyy-mm-dd">
                <input type="button" class="btn btn-info form-control" value="查询" onclick="dateCheck()"
                       style="margin-bottom: 0"/>
            </td>
        </tr>
    </table>
</form>
<table class="table table-bordered">
    <tr bgcolor="#E7E7E7">
        <td height="14" colspan="7">统计结果</td>
    </tr>
    <tr align="center" bgcolor="#FAFAF1">
        <td width="10%">金额</td>
        <td width="16%">日期</td>
    </tr>
    <s:iterator value="#request.orderList" var="order">
        <tr align='center'>
            <td bgcolor="#FFFFFF" align="center">
                ￥<s:property value="#order.orderPrice"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#order.orderDate"/>
            </td>
        </tr>
    </s:iterator>
</table>
<jsp:include page="/common/page.jsp" flush="true"/>
<script>
    function dateCheck() {
        if (document.formFind.fromDate.value.length < 1) {
            alert("请选择开始日期");
            return false;
        }
        if (document.formFind.fromDate.value.length < 1) {
            alert("请选择结束日期");
            return false;
        }
        document.formFind.submit();
    }
    $('#dateFrom').datetimepicker({
        autoclose: true,
        minView: 2,
        maxView: 3,
        initialDate: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000)
    });
    $('#dateTo').datetimepicker({autoclose: true, minView: 2, maxView: 3});
</script>
<jsp:include page="/admin/inc/incFoot.jsp" flush="false"/>
